const obj = {
  getImage: ['images', 'png'],
  getAudio: ['audios', 'mp3'],
  getVideo: ['videos', 'mp4'],
}

export default Object.entries(obj).reduce((p, c) => {
  const [key, [fileBasePath, defaultFileSuffix]] = c

  p[key] = path => {
    const url = path.includes('.') ? path : path + '.' + defaultFileSuffix
    return `/static/${fileBasePath}/${url}`
  }
  return p
}, <Record<keyof typeof obj, (path: string) => string>>{})